#pragma once
#include "pch.h"
#include <vector>
#include <memory>
using namespace std;

struct CViewportController;
class ControlPoint;
struct CBandList
{
	struct ImageBands
	{
		CString strBandName;

		UCHAR ** pBandR;
		UCHAR ** pBandG;
		UCHAR ** pBandB;

		/*std::shared_ptr <BYTE *> pBandR;
		std::shared_ptr <BYTE *> pBandG;
		std::shared_ptr <BYTE *> pBandB;*/

		int iHeight;
		int iWidth;
		CImage PreviewImg;
	};

	// CBandList::ImageBands {_T(""), a, b, c, 1, 2}

	std::vector<ImageBands> m_ImageBand;

	void push_ImageBands(const ImageBands& ImageB);

	static ImageBands ReadImageBands(CString strReadPath);

	static void SaveImageBands(CString strSavePath, ImageBands Image);

	CViewportController* ViewportBase;
	CViewportController* ViewportAdjust;
	ControlPoint* ConPoint;

	void ShowViewportBase(ImageBands TempImage, CString RName, CString GName, CString BName, BOOL ABFlag);

	void OutputImage(CString strOutputPath, CString Rname, CString Gname, CString Bname);

	void Init_BitMap_FileHeader(int nWidth, int nHeight, int colorbit, BITMAPFILEHEADER* pbmfh, BITMAPINFOHEADER* pbmih);

	BITMAPFILEHEADER    bmfh;
	BITMAPINFOHEADER    bmih;

	inline static CBandList& GetInstance() {
		return _singleton;
	}

	void PredictPoint(CPoint point);
private:
	static CBandList _singleton;
	inline explicit CBandList() {}
};

// CBandList::GetInstance().m_Image_Band[0]

#include "CViewportController.h"
#include "ControlPoint.h"
